<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-10">
	<form method="post" action="?m=shop&c=shop_admin&a=deliver&sid=<?php echo $_GET['sid']?>" name="myform" id="myform">
		<table class="table_form" width="100%">
			<tbody>
        <tr>
          <th>订单编号</th>
          <td><?php echo $shop_info['ordersn']?></td>
        </tr>
        <tr>
          <th>下单时间</th>
          <td><?php echo date('Y-m-d H:m:s', $shop_info['addtime']) ?></td>
        </tr>
				<tr>
					<th width="80">商品名称</th>
					<td><?php echo $shop_info['goodsname']?></td>
				</tr>
				<tr>
					<th>商品价格</th>
					<td>¥ <?php echo $shop_info['goodsprice']?></td>
				</tr>
				<tr>
					<th>收件人</th>
					<td><strong><?php echo $shop_info['username']?></strong></td>
				</tr>
				<tr>
					<th>收件人电话</th>
					<td><strong><?php echo $shop_info['phone']?></strong></td>
				</tr>
				<tr>
					<th>收件人地址</th>
					<td><strong><?php echo $shop_info['address']?></strong></td>
				</tr>
				<tr>
					<th>备注</th>
					<td><strong><?php echo $shop_info['content']?></strong></td>
				</tr>
				<tr>
					<th>支付状态</th>
					<td><?php echo ($shop_info['status']==1) ? '<span style="color:green">已支付</span>' : '<span style="color:red">未支付</span>';?></td>
				</tr>
        <tr>
					<th>微信单号</th>
					<td><?php echo $shop_info['tradeno']?></td>
				</tr>
        <tr>
					<th>发货单号</th>
					<td><input type="text" name="trackingid" value="<?php echo $shop_info['trackingid']?>"></td>
				</tr>

			</tbody>
		</table>
		<input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class="dialog">&nbsp;<input type="reset" class="dialog" value=" <?php echo L('clear')?> ">
	</form>
</div>
</body>
</html>
<script type="text/javascript">

$(document).ready(function(){

	$.formValidator.initConfig({
		formid:"myform",
		autotip:true,
		onerror:function(msg,obj){
			window.top.art.dialog(
        { content:msg, lock:true, width:'220', height:'70' },
        function(){ this.close(); $(obj).focus(); }
      )
		}
	});

});

/**
 * 手工查单
 * @param  [type] orderSN [description]
 * @return [type]         [description]
 */
// function checkOrder(orderSN)
// {
//   $.post("?m=shop&c=shop&a=pollingOrder",{orderSN:orderSN},function(result){
//     if (result == 1) {
//
//     }
//     else {
//       var myDate = new Date();
//       $('.checkOrderMsg').text('未支付（'+myDate.toLocaleTimeString()+'）');
//     }
//   });
// }
</script>
